home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PPC1B3AA.ZIP / BRACKETS.PPS < prev    next >
Text File  |  1996-08-09  |  708b  |  25 lines

  1. ;----------------------------------------------------------------------------
  2. ;
  3. ; This example demonstrate the use of brackets []
  4. ;
  5. ;----------------------------------------------------------------------------
  6.  
  7. #ppe
  8.  
  9. Integer IntVar
  10. String StrVar
  11.  
  12. IntVar = 86123
  13. StrVar = "86123"
  14.  
  15. PrintLn StrVar[3]                  ; Prints the 3rd char of var strvar
  16. PrintLn StrVar[StrVar[3]]          ; Print the nth char of strvar depending
  17.                                    ; on 3rd char
  18.  
  19. ; The same thing may be achieved on Integers, or any other datatype.
  20. ; Just consider their value is first converted to String
  21.  
  22. PrintLn IntVar[3]
  23. PrintLn IntVar[IntVar[3]]
  24.                                    
  25.